<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>通过鼠标实现选项卡</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            width: 100%;
            height: 100%;
        }
        #container{
            width: 400px;
            height: 300px;
            display: flex;
            flex-direction: column;
            border: 1px solid #666;
        }
        #container header{
            flex: 0 0 80px;
            width: 100%;
        }
        #container header ul{
            width: 100%;
            height: 100%;
            background-color: red;
            list-style: none;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #container header ul li{
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
        }
        #container header ul li:hover{
            background-color: white;
            color: gainsboro;
        }
        #container #content{
            flex: 1;
        }
        #container #content div{
            width: 100%;
            height: 100%;
            background-color: gainsboro;
        }
        .show{
            display: block;
        }
        .hide{
            display: none;
        }
    </style>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <div id="container">
        <header>
            <ul>
                <li @mouseover="flag=true">选项一</li>
                <li @mouseover="flag=false">选项二</li>
            </ul>
        </header>
        <div id="content" >
            <div id="a" :class="{show:flag,hide:!flag}">
                这TND是选项一
            </div>
            <div id="b" :class="{show:!flag,hide:flag}">
                这TND是选项二
            </div>
        </div>
    </div>
</div>
<script>
    let app=new Vue({
       el:"#app" ,
        data:{
           flag:true
        }
    });
</script>
</body>
</html>